cmake_minimum_required(VERSION 3.16)

project(hkcam)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_PREFIX_PATH "/home/shuai/Qt/5.15.2/gcc_64")

find_package(Qt5 COMPONENTS Core Gui Widgets OpenGL Concurrent REQUIRED)
find_package(OpenCV REQUIRED)

set(SOURCES
    src/main.cpp
    src/mainwindow.cpp
)

SET(HEADERS 
    HK_SDK/headers/HCNetSDK.h
    HK_SDK/headers/LinuxPlayM4.h
    include/mainwindow.h
)

set(FORMS
    src/mainwindow.ui
)

include_directories(
    HK_SDK/headers
    include
    ${OpenCV_INCLUDE_DIRS}
    ${Qt5Core_INCLUDE_DIRS}
    ${Qt5Gui_INCLUDE_DIRS}
    ${Qt5Widgets_INCLUDE_DIRS}
    ${Qt5OpenGL_INCLUDE_DIRS}
)

set(LIBRARY_DIR 
    "${CMAKE_SOURCE_DIR}/HK_SDK/lib"
    "${CMAKE_SOURCE_DIR}/HK_SDK/lib/HCNetSDKCom"
)
link_directories(${LIBRARY_DIR})

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/HK_SDK/lib)

add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS} ${FORMS})

target_link_libraries(${PROJECT_NAME} 
    ${OpenCV_LIBS}
    Qt5::Core
    Qt5::Gui
    Qt5::Widgets
    Qt5::OpenGL
    Qt5::Concurrent
    AudioRender
    HCCore
    hcnetsdk
    PlayCtrl
    SuperRender
    HCAlarm
    HCGeneralCfgMgr
    HCPreview
)